import 'package:baselib/utils/image_util.dart';
import 'package:flutter/material.dart';
import 'package:framelib/utils/color_util.dart';
import 'package:framelib/utils/drawable_util.dart';
import 'package:framelib/utils/px_util.dart';

class RoomTopWidget extends StatelessWidget {
   Function onRoomClose;
   RoomTopWidget({Key key,this.onRoomClose}) : super(key: key);

  @override
  Widget build(BuildContext context) {

    return UnconstrainedBox(
      constrainedAxis: Axis.vertical,
      child: SizedBox(
        width: PxUtil.instance.screenWidth,
        child: Dialog(
          insetPadding: EdgeInsets.only(),
          alignment: Alignment.topCenter,
          backgroundColor: Colors.transparent,
          child: Material(
            type: MaterialType.transparency,
            child: Container(
              color: ColorUtil.instance.color_304275,
              width: PxUtil.instance.screenWidth,
              height: PxUtil.instance.px_150,
              child: Center(
                child: GestureDetector(
                  onTap:()=> ((onRoomClose==null)?((){}):(onRoomClose())),
                  child: ImagesUtil.loadAssetImage(
                    DrawableUtil.instance.icon_room_pop_close,
                    width: PxUtil.instance.px_60,
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
